package com.fita.admin.service.client;

import com.demo2do.core.entity.exception.BusinessException;
import com.fita.admin.entity.search.client.ClientSearch;
import com.fita.admin.entity.security.Login;
import com.fita.admin.service.DataService;
import com.fita.entity.client.Client;

import java.util.List;

/**
 * @description:
 * @author: 11200
 * @date: 2019/6/21
 */
public interface ClientService extends DataService<Client> {

    /**
     * 添加客户
     * @param client
     * @param login
     */
    void addClient(Client client, Login login) throws BusinessException;

    /**
     * 修改
     * @param clientId
     * @param client
     */
    void edit(Long clientId, Client client);

    /**
     * 绑定代理
     * @param clientId
     * @param agentId
     */
    void bindAgent(Long clientId, Long agentId);

    /**
     * 计算销售额(分)
     * @param clientId
     * @return
     */
    int calculateSales(Long clientId);

    /**
     * 导出
     * @param search
     * @return
     */
    List<Client> export(ClientSearch search);

}
